home *** CD-ROM | disk | FTP | other *** search
/ Singles Flirt Up Your Life! (German) / Singles Flirt Up Your Life.iso / data1.cab / Statemachine / questErotic5.lua < prev    next >
Text File  |  2004-01-29  |  2KB  |  75 lines

  1. beginStateMachine()
  2.  
  3.     -- called when questor builds up all known questScripts
  4.     onEnter(function(msg)
  5.         print("questErotic5 entered");
  6.         setState("initial");
  7.     end )
  8.     
  9.     -- on game over: relationship conditions get reset to 0 and all quests are reset to initial
  10.     onMsg("questreset", function(msg)
  11.         setState("initial");
  12.     end ) 
  13. ---------------------------------------------------------------------------------------------------------------------------------------    
  14.     
  15.     state("initial") 
  16.         onMsg("checkCondition", function(msg)
  17.             local mike = getParent().getParent().getCharacter(MIKE);
  18.             local elaine = getParent().getParent().getCharacter(ELAINE);
  19.  
  20.             if ( -- condition here
  21.         ----------------
  22.                 min(    mike.getRelationshipCondition(ELAINE, REL_EROTIC),
  23.                     elaine.getRelationshipCondition(MIKE, REL_EROTIC) ) >= 5)
  24.         ----------------
  25.             then
  26.                 -- popup kiss chapter
  27.                 popupChapter("guiStoryChapterGroup2");
  28.                 
  29.                 setDelayedState("talktome", 10);
  30.             end
  31.         end )
  32.         
  33.         
  34.     state("talktome")
  35.         onEnter(function(msg)
  36.             local mike = getParent().getParent().getCharacter(MIKE);
  37.             local elaine = getParent().getParent().getCharacter(ELAINE);
  38.  
  39.             -- go to talk position
  40.             mike.queueCommand("pm_talkCutscene", "talkCutscene", elaine, "questErotic5");
  41.         end )
  42.  
  43.         -- assoon as arrived - start dialog
  44.         onMsg("talking", function(msg)
  45.             if (msg.data == "questErotic5") then
  46.                 popupConversation("dialogErotic5");
  47.                 setState("donetalktome");
  48.             end
  49.         end )
  50.         
  51.     state("donetalktome");
  52.         onMsg("yes", function(msg)
  53.             local mike = getParent().getParent().getCharacter(MIKE);
  54.             local elaine = getParent().getParent().getCharacter(ELAINE);
  55.  
  56.             mike.cancelCurrentActivity();
  57.             elaine.cancelCurrentActivity();
  58.             
  59.             setState("done");            
  60.         end )
  61. ---------------------------------------------------------------------------------------------------------------------------------------    
  62.  
  63.         
  64.     state("done")
  65.     
  66.     -- sackgasse hier
  67.         
  68.         
  69.         
  70. endStateMachine()
  71.  
  72.  
  73.  
  74.  
  75.